package com.cljz.makepassenger.ui.holder;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.cljz.makepassenger.base.App;
import com.cljz.makepassenger.R;
import com.cljz.makepassenger.model.net.bean.ActivityIndexBean;
import com.squareup.picasso.Picasso;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by apple on 2017/4/24.
 */

public class HotEventsHolder extends RecyclerView.ViewHolder {

    @BindView(R.id.iv_activity_pic)
    ImageView ivActivityPic;
    @BindView(R.id.tv_activity_des)
    TextView tvActivityDes;

    public HotEventsHolder(View itemView) {
        super(itemView);
        ButterKnife.bind(this, itemView);

    }

    public void setData(List<ActivityIndexBean.DataBean.ActivityBean> hotEventsList, int position) {
        ActivityIndexBean.DataBean.ActivityBean dataBean = hotEventsList.get(position);
        Picasso.with(App.getInstance()).load(dataBean.getImg_path()).error(R.mipmap.activity_loading).placeholder(R.mipmap.activity_loading).into(ivActivityPic);
        tvActivityDes.setText(dataBean.getTitle());
    }
}
